/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.transas.zornav.data;

import java.text.NumberFormat;
import java.util.Locale;

/**
 *
 * @author amalikov
 */
public class SimpleFormatter implements Formatter {

	public SimpleFormatter(int minFraction, int maxFraction) {
		nf = NumberFormat.getNumberInstance(Locale.US);
		nf.setMinimumFractionDigits(minFraction);
		nf.setMaximumFractionDigits(maxFraction);
		nf.setGroupingUsed(false);
	}
	
	@Override
	public String get(double value) {
		return nf.format(value);
	}

	private NumberFormat nf;
}
